{template 'common/header'}
<style>
    .help-text{
        padding:5px 0;
        font-size:15px;
        color:red;
        display: block;
    }
</style>
<div class="panel panel-info">
    <div class="panel-heading">参数</div>
    <div class="panel-body">
        <form class="form-horizontal" id="form">
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">开关</label>
                <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12">
                    <div class="radio">
                        <label>
                            <input 
                                {php echo $config['lianxu_status']==1?'checked':'';} 
                                type="radio" name="lianxu_status"  value="1">
                                开启
                        </label>
                        <label>
                            <input 
                                {php echo $config['lianxu_status']==2?'checked':'';} 
                                type="radio" name="lianxu_status" value="2">
                                关闭
                        </label>
                    </div>
                    <div style="color:red;font-size:12px;" class="radio">
                        <span>
                        </span>
                    </div>
                </div>
            </div>
             <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">活动主图</label>
                <div class="col-sm-6 col-md-8 col-lg-8 col-xs-12">
                    {php echo tpl_form_field_image('lianxu_imgurl', $config['lianxu_imgurl'], $default = '', $options = array());}
                    <span class="help-text">
                    </span>
                </div>
            </div>
            <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">活动详情</label>
                    <div class="col-sm-9 col-xs-12">
                            {php echo tpl_ueditor('lianxu_detail', $config['lianxu_detail']);}
                    </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
                <div class="col-xs-12 col-sm-3 col-md-2 col-lg-2">
                    <a type="button" onclick="submit()" class="btn btn-primary">提交</a>
                </div>
            </div>
        </form>
    </div>
</div>
{template 'common/footer'}
<script>
    function submit() {
        var data = $('#form').serialize();
        $.ajax({
            url: window.location.url,
            data: data,
            type: 'post',
            dataType: 'json',
        }).then(function (res) {
            if (res.ret == 0) {
                util.message('修改成功');
            } else {
                util.message(res.message, '', 'error');
            }
        });
    }
</script>
